package com.molin.StreamTest;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

public class Demo8 {
    public static void main(String[] args) {
        ArrayList<String> stuInfo = new ArrayList<>();
        stuInfo.add("zhangsan,23");
        stuInfo.add("王五,24");
        stuInfo.add("李四,26");
        Map<String,String> studentInfoMap= stuInfo.stream().filter((s) -> {
            String arr[] = s.split(",");
        return Integer.parseInt(arr[1])>=24;
        }).collect(Collectors.toMap(
                (String s)->{return s.split(",")[0];},
                (String s)->{return s.split(",")[1];}
        ));

        System.out.println(studentInfoMap);
    }
}
